package com.dingding.gmall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dingding.gmall.common.utils.PageUtils;
import com.dingding.gmall.order.command.SubmitOrderCommand;
import com.dingding.gmall.order.dto.FareInfoDTO;
import com.dingding.gmall.order.entity.OrderEntity;
import com.dingding.gmall.order.vo.OrderTradeVO;
import com.dingding.gmall.order.vo.PayAsyncVo;
import com.dingding.gmall.order.vo.SubmitOrderResponseVO;

import java.text.ParseException;
import java.util.Map;

/**
 * 订单
 *
 * @author liudingding
 * @email sunlightcs@gmail.com
 * @date 2020-07-02 22:47:16
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 结算价格
     * @return
     */
    OrderTradeVO tradeOrder();

    /**
     * 获取运费
     * @param addressId
     * @return
     */
    FareInfoDTO getFare(Long addressId);

    /**
     * 下订单
     * @param command
     * @return
     */
    SubmitOrderResponseVO submitOrder(SubmitOrderCommand command);

    OrderEntity getOrderStatus(String orderSn);

    void closeOrder(OrderEntity entity);

    /**
     * 分页查询当前登录用户的所有订单
     * @param params
     * @return
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 处理支付宝返回的支付结果
     * @param vo
     * @return
     */
    String handleAliPayedResult(PayAsyncVo asyncVo) throws ParseException;
}

